package counter.com.common;

import lombok.Data;

import java.io.Serializable;

@Data
public class Result implements Serializable {
    private int status;
    private Object data;

    public static Result success(Object data) {
        Result r = new Result();
        r.setStatus(1);
        r.setData(data);
        return r;
    }

    public static Result fail(Object data) {
        Result r = new Result();
        r.setStatus(0);
        r.setData(data);
        return r;
    }

    @Override
    public String toString() {
        return "Result{" +
                "status=" + status +
                ", data=" + data +
                '}';
    }
}
